<%--
  Created by wsx.
  User: Administrator
  Date: 2020/3/31
  Time: 14:44
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <link rel="stylesheet" href="layui/css/layui.css">
    <script src="layui/layui.js"></script>
    <title>修改图书信息</title>

    <style>
        * {
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }

        body {
            background-color: rgb(233, 236, 245);
        }

        .main-form {
            background-color: white;
            border: 1px solid gray;
            border-radius: 5px;
            width: 550px;
            height: 630px;
            margin-left: 500px;
            margin-top: 10px;
            padding-right: 30px;
        }

        #fontform {
            font-size: 25px;
            font-family: 微软雅黑;
            padding-left: 200px;
            margin-bottom: 20px;
            margin-top: 10px;
            color: #FFB800;
        }

        .layui-input-block {
            margin-bottom: 15px;
        }

    </style>
</head>
<body>
<%--头部--%>
<ul class="layui-nav" lay-filter="">
    <!--    layui-this-->
    <li class="layui-nav-item"><a href="books_home.jsp">首页</a></li>
    <li class="layui-nav-item   layui-this">
        <a href="javascript:;">图书管理</a>
        <dl class="layui-nav-child "> <!-- 二级菜单 -->
            <dd><a href="${pageContext.request.contextPath}/pageServlet?currentPage=1" style="font-size: 15px">图书清单</a>
            </dd>
            <dd><a href="books_search.jsp" style="font-size: 15px">图书查询</a></dd>
            <dd><a href="books_add.jsp" style="font-size: 15px">添加图书</a></dd>
        </dl>
    </li>

    <li class="layui-nav-item">
        <a href="javascript:;">读者管理</a>
        <dl class="layui-nav-child"> <!-- 二级菜单 -->
            <dd><a href="${pageContext.request.contextPath}/userInfo?currentPage=1" style="font-size: 15px">信息显示</a></dd>
            <dd><a href="manager_adduser.jsp" style="font-size: 15px">添加读者</a></dd>
        </dl>
    </li>

    <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/borrowInf?currentPage=1">图书借阅信息</a></li>
    <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/returnbooks?currentPage=1">图书归还信息</a></li>
    <li class="layui-nav-item" style="float: right">
        <a href=""><img src="img/user.png" width="37px" height="38px" class="layui-nav-img">我</a>
        <dl class="layui-nav-child">
            <dd><a href="javascript:exit();">退出</a></dd>
        </dl>
    </li>
</ul>
</div>

<div class="main-form">
    <p id="fontform">修改图书信息</p>
    <form class="layui-form" action="modifyBooks" method="post">
<%--        隐藏的input 用来传递id变量--%>
        <input type="hidden" value="${requestScope.books.id}" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label">书号</label>
            <div class="layui-input-block">
                <input type="text" name="number" value="${requestScope.books.number}" autocomplete="off"
                       class="layui-input">
            </div>
            <label class="layui-form-label">书名</label>
            <div class="layui-input-block">
                <input type="text" name="name" value="${requestScope.books.name}" placeholder="请输入书名" autocomplete="off"
                       class="layui-input">
            </div>
            <label class="layui-form-label">作者</label>
            <div class="layui-input-block">
                <input type="text" name="author" value="${requestScope.books.author}" placeholder="请输入作者"
                       autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label">出版社</label>
            <div class="layui-input-block">
                <input type="text" name="press" value="${requestScope.books.press}" placeholder="请输入出版社"
                       autocomplete="off" class="layui-input">
            </div>
            <label class="layui-form-label">数量</label>
            <div class="layui-input-block">
                <input type="text" name="num" value="${requestScope.books.num}" placeholder="请输入库存数量" autocomplete="off"
                       class="layui-input">
            </div>
            <label class="layui-form-label">日期</label>
            <div class="layui-input-block">
                <input type="text" name="date" value="${requestScope.books.date}" placeholder="请输入出版日期"
                       autocomplete="off" class="layui-input">
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">类别</label>
                <div class="layui-input-block">
                    <%--                    <c:if test="${requestScope.books.press=='精品'}">--%>
                    <input type="radio" name="category" value="普通" title="普通" checked>
                    <input type="radio" name="category" value="新书" title="新书">
                    <input type="radio" name="category" value="精品" title="精品">

                </div>
            </div>


            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">简介</label>
                <div class="layui-input-block">
                    <%--注意 textarea的赋值是在两个标签之间 与input不同--%>
                    <textarea name="information" placeholder="请输入内容"
                              class="layui-textarea">${requestScope.books.information}</textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo" style="width: 90px">立即修改</button>
                    <button type="reset" class="layui-btn layui-btn-normal" style="width: 90px">重置</button>
                    <button type="reset" class="layui-btn  layui-btn-warm" style="width: 90px"
                            onClick="javascript:history.back(-1);">返回
                    </button>
                </div>
            </div>

        </div>
    </form>
</div>

</body>

<script>
    //Demo
    layui.use('form', function () {
        var form = layui.form;
    });
</script>

<script type="text/javascript">
    function exit() {
        if(confirm("您确定要退出吗？")){
            location.href="Login.html";
        }
    }
</script>

<script type="text/javascript">
    //注意：导航 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;
    });
</script>
</html>
